using MediatR;
using Medical.ErrorCode;
using Medical.Api.Write.Service.WmsService;
using System.Threading;
using System.Threading.Tasks;
using Medical.Api.Write.Application.Command.Wms.WmsOutCommand;

namespace Medical.Api.Write.Application.Handler.Wms.WmsOutHandler
{
    /// <summary>
    /// 出库撤销审批处理器
    /// </summary>
    public class UndoAuditOutHandler : IRequestHandler<UndoAuditOutCommand, ApiResult<bool>>
    {
        private readonly IWmsService _service;
        public UndoAuditOutHandler(IWmsService service) { _service = service; }
        public async Task<ApiResult<bool>> Handle(UndoAuditOutCommand request, CancellationToken cancellationToken)
        {
            return await _service.UndoAuditOutAsync(request.Id);
        }
    }
}